import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'

import './style.less';

class Label extends Component {
  navTo = () => {
    Taro.navigateTo({
      url: '../../pages/history/index'
    })
  }
  render() {
    const { type, title, rightTitle } = this.props;
    return (
      <View className='subTitle'>
        <View className={`padding ${type === 'special' ? 'special' : ''}`} ></View>
        <View className={`text ${type === 'special' ? 'special-text' : ''}`}>{title}</View>
        {
          rightTitle ? (
            <View className='right' onClick={this.navTo} >
              {rightTitle}
            </View>
          ) : null
        }
      </View>
    )
  }
}

export default Label;
